using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Data.Entity.ModelConfiguration.Configuration;

namespace KeyCore.Domain.Model
{
    public class Kraj
    {
        public Kraj()
        {
            Adres = new HashSet<Adres>();
        //    TelefonPrefix = new HashSet<TelefonPrefix>(); 
        }

        public int KrajId { get; set; }
        public string Nazwa { get; set; }

        public virtual ICollection<Adres> Adres { get; set; }
   //     public virtual ICollection<TelefonPrefix> TelefonPrefix { get; set; } 
    }

    public class KrajConfiguration : EntityTypeConfiguration<Kraj>
    {
        public KrajConfiguration()
        {
            HasKey(k => k.KrajId)
                .Property(p => p.KrajId)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
        }
    }
}